home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / emacs16d.zip / ASM.MIN < prev    next >
INI File  |  1991-07-15  |  6KB  |  266 lines

  1. [*]#(==,##(fm,Fext-mode-list,ASM,no)#(rs,Fext-mode-list),no,(
  2.     #(ds,Fext-mode-list,##(Fext-mode-list)(.asm,ASM,
  3. ))
  4. ))
  5. #(ds,Fmodified)
  6. #(F:save-all-libs)
  7. [*]
  8.  
  9.  
  10. Support for assembly language.  Press C-c C-c to install, then answer 'y'
  11. to write the changes to disk.
  12.  
  13. Name:U:asm-format
  14. Reformat assembly language into a consistent indentation format.
  15. [*]#(sp,^)
  16. #(Flooking-at,\w\w*:,(
  17.     #(sp,2)
  18. ))
  19. #(pm,1)
  20. #(Fforward-skip-white,no)
  21. #(dm,0)
  22. #(pm)
  23. #(Flooking-at,\W,,(
  24.     #(is,(    ))
  25.     #(Flooking-at,\w\w*,(
  26.         #(sp,2)
  27.     ))
  28.     #(pm,1)
  29.     #(Fforward-skip-white,no)
  30.     #(dm,0)
  31.     #(pm)
  32.     #(Flooking-at,\W,,(
  33.         #(is,(    ))
  34.     ))
  35. ))
  36. [*]
  37.  
  38.  
  39. Name:U:old-asm-format
  40. Reformat assembly language into a consistent indentation format.
  41. [*]#(sp,^)
  42. #(Fwhitespace,(
  43.     #(F:kill-spaces)
  44.     #(==,##(rc,$),0,,(
  45.         #(sp,^<^)
  46.         #(Fforward-skip-white,no)
  47.         #(ds,temp,#(Fcase,##(bc,##(rm,>)),
  48.             (##(bc,;),((    ))),
  49.             (13,((    ))),
  50.             (##(rm,^))
  51.         ))
  52.         #(sp,$)
  53.         #(==,##(rm,<),:,(#(ds,temp,(    ))))
  54.         #(sp,$>)
  55.         #(is,#(==,##(temp),,(    ),(##(temp))))
  56.     ))
  57. ),,nocrlf)
  58. #(Uasm-format-do)
  59. #(sp,$>)[*]
  60.  
  61.  
  62. Name:F:asm-mode
  63. [*]#(F:ASM-mode)[*]
  64.  
  65.  
  66. Name:Uold-asm-format-do
  67. [*]#(Fcase,##(bc,##(rm,>)),
  68.     (##(bc,"),),
  69.     (##(bc,'),),
  70.     (##(bc,;),),
  71.     (13,),
  72.     (
  73.         #(Fwhile-yes,(
  74.             #(Fwhitespace,,(
  75.                 #(sp,>)
  76.                 yes
  77.             ))
  78.         ))
  79.         #(==,##(rc,$),0,,(
  80.             #(F:kill-spaces)
  81.             #(==,##(rm,<),(,),,(
  82.                 #(is,(    ))
  83.             ))
  84.             #(SELF)
  85.         ))
  86.     )
  87. )[*]
  88.  
  89.  
  90. Name:U:masm
  91. [*]#(ds,masm-buffer,#(Fbuffer-fn))
  92. #(F:write-modified-files)
  93. #(Ffind-or-make-buffer,*masm*)
  94. #(ex,#(Fsearch-path,masm),#(masm-buffer);,,\pipe_out,\pipe_out)
  95. #(rf,\pipe_out)
  96. #(de,\pipe_out)
  97. #(ds,error-buffer,##(ba,-1))
  98. #(es,error-handler)
  99. #(ds,k,##(gs,Fredisplay-two))
  100. #(sv,ow,##(ba,-1))
  101. #(sp,[)
  102. #(..,##(ba,##(old-buffer)))
  103. #(Fenter-local-modes)
  104. [*]
  105.  
  106.  
  107. Name:U:ASM-colon
  108. Insert a colon, and delete the indentation iff it follows a label.
  109. [*]#(Fsave-excursion,(
  110.     #(sp,^)
  111.     #(Flooking-at,([ ##(bc,9,d,a)][ ##(bc,9,d,a)]*[a-zA-Z_][a-zA-Z_]*$),(
  112.         #(Ffind-non-blank,>,arg1)
  113.         #(dm,^)
  114.     ))
  115. ))
  116. #(is,:)[*]
  117.  
  118.  
  119. Name:U:ASM-comment
  120.   Introduce a comment or convert an already existing comment into a
  121. comment of a different kind.  These are the known comment classes:
  122.  
  123.     1-- to the right of the code (at the comment-column)
  124.     2-- comment on a own line, indented like code
  125.     3-- at the left-most column.
  126.     4-- surrounded by two #(F-left-comment)#(F-comment-filler)#(F-right-comment)
  127.  
  128. Suggested usage:  while writing your code, trigger asm-comment
  129. repeatedly until you are satisfied with the kind of comment.
  130. [*]    
  131. #(==,arg1,,(
  132.     #(pm,1)
  133.     #(sp,^)
  134.     #(lp,##(F-left-comment))
  135.     #(l?,.,$,0,,(
  136.         #(sp,0)
  137.         #(==,##(rc,^),0,(
  138.             #(UASM-comment)
  139.         ),(
  140.             #(==,##(lv,cs),##(F-comment-column),(
  141.                 #(F:delete-horizontal-space)
  142.                 #(==,##(rc,^),0,(
  143.                     #(sp,$)
  144.                 ),(
  145.                     #(Fcrlf)
  146.                     #(Fpad-to-column,##(F-comment-column))
  147.                 ))
  148.             ),(
  149.                 #(F:indent-for-comment)
  150.             ))
  151.         ))
  152.     ),(
  153.         #(F:indent-for-comment)
  154.     ))
  155.     #(pm)
  156. ),(
  157.     #(F:indent-for-comment)
  158. ))
  159. [*]
  160.  
  161.  
  162. Name:UASM-comment
  163. Given a comment at the left line, determine if it is already
  164. surrounded by comment filler lines.  If it's not surrounded by comment
  165. filler lines, add them.  If it is, delete them.  If it's a single line
  166. of comments, append the comment to the previous line and run
  167. F:indent-for-comment on it.
  168.  
  169. Mark 0 points to the first comment line.  Mark 1 points after the last
  170. contiguous comment line.
  171. [*]
  172. #(pm,3)
  173. #(sp,^)
  174. #(Fwhile-yes,(
  175.     #(Flooking-at,#(Fregexp-quote,(##(F-left-comment))),(
  176.         #(==,##(rc,[),0,,(
  177.             #(sp,^<^)
  178.             yes
  179.         ))
  180.     ),(
  181.         #(sp,$>)
  182.     ))
  183. ))
  184. #(sm,0)
  185. #(Fwhile-yes,(
  186.     #(Flooking-at,#(Fregexp-quote,(##(F-left-comment))),(
  187.         #(sp,$)
  188.         #(==,##(rc,]),0,,(
  189.             #(sp,$>)
  190.             yes
  191.         ))
  192.     ))
  193. ))
  194. #(sm,1)
  195. #(==,
  196.     #(sp,0)
  197.     #(Flooking-at,#(Fregexp-quote,(##(F-left-comment)##(F-comment-filler)##(F-comment-filler)##(F-comment-filler)##(F-comment-filler)##(F-comment-filler))),yes)
  198.     #(sp,1<^)
  199.     #(Flooking-at,#(Fregexp-quote,(##(F-left-comment)##(F-comment-filler)##(F-comment-filler)##(F-comment-filler)##(F-comment-filler)##(F-comment-filler))),yes)
  200. ,yesyes,(
  201.     #(sp,0)
  202.     #(dm,$>)
  203.     #(sp,1<^)
  204.     #(dm,$>)
  205.     #(==,#(--,#(lv,cl)#(sp,0),#(lv,cl)),1,(
  206.         #(sp,2)
  207.         #(dm,<)
  208.         #(F:indent-for-comment)
  209.     ))
  210. ),(
  211.     #(sp,0)#(Uinsert-filled-comment,##(F-fill-column))#(Fcrlf)
  212.     #(sp,1)#(Uinsert-filled-comment,##(F-fill-column))#(Fcrlf)
  213. ))
  214. #(sp,2)
  215. #(pm)
  216. [*]
  217.  
  218.  
  219. Name:Uinsert-filled-comment
  220. Insert left-comment, append comment fillers until we get to the arg1 column,
  221. then insert right-comment.  Probably a reasonable value to use for arg1 is
  222. ##(F-fill-column).
  223. [*]#(is,
  224.     ##(F-left-comment)
  225.     #(Floop,##(F-comment-filler),
  226.         #(--,
  227.             #(--,arg1,#(nc,#(F-left-comment)))
  228.         ,##(nc,##(F-right-comment))))
  229.     ##(F-right-comment)
  230. )[*]
  231.  
  232.  
  233.  
  234. Name:F-comment-filler
  235. The thing to fill comments with to form a divider line
  236. [*]-[*]
  237.  
  238.  
  239. Name:F:ASM-mode
  240. This will set the local mode to Assembly Language.
  241. [*]#(Fexit-mode)
  242. #(Flocal-bind-key,F-left-comment,;)
  243. #(Flocal-bind-key,F-right-comment,)
  244. #(Flocal-bind-key,K.M-;,U:ASM-comment)
  245. #(Flocal-bind-key,K.M-C-i,U:asm-format)
  246. #(Flocal-bind-key,K.M-Tab,U:asm-format)
  247. #(Flocal-bind-key,staydown-hook,(
  248.     #(n?,UASM-staydown-do.ARG1,(
  249.         #(UASM-staydown-do.ARG1)
  250.     ),(
  251.         #(Fstaydown-do-do,ARG1)
  252.     ))
  253. ))
  254. #(mp,staydown-hook,,ARG1)
  255. #(ds,syntax,##(Fsyntax))
  256. #(Fmodify-syntax,syntax,##(bc,$),1)
  257. #(Fmodify-syntax,syntax,##(bc,.),1)
  258. #(st,syntax)
  259. #(Fset-modename,ASM)
  260. [*]
  261.  
  262.  
  263. Name:UASM-staydown-do.59
  264. [*]#(Fbackward-skip-white)
  265. #(Fstaydown-mark,$)[*]
  266.